package jay.home.templates;

import java.util.*;
import jay.home.utils.*;

public class JspTemplate
{
  protected static String nl;
  public static synchronized JspTemplate create(String lineSeparator)
  {
    nl = lineSeparator;
    JspTemplate result = new JspTemplate();
    nl = null;
    return result;
  }

  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<%@ page language=\"java\" contentType=\"text/html; charset=utf-8\" pageEncoding=\"utf-8\"%>" + NL + "<%@ include file=\"/WEB-INF/jsp/IncludeTop.jsp\" %>" + NL + "<!------------------------------------------>" + NL + "" + NL + "" + NL + "<c:if test=\"${!empty message}\">" + NL + "  <b><font color=\"BLUE\"><c:url value=\"${message}\"/></font></b>" + NL + "</c:if>" + NL + "<c:if test=\"${!empty errors}\">" + NL;
  protected final String TEXT_2 = NL;
  protected final String TEXT_3 = NL + NL + NL + "<html:form action=\"/";
  protected final String TEXT_4 = "/";
  protected final String TEXT_5 = "\" method=\"post\">" + NL + "      <table border=\"0\">" + NL + "        <tr>" + NL + "          <td>Login:</td><td>input for field</td>" + NL + "        </tr>" + NL + "        <tr>" + NL + "          <td>Password:</td><td>input for filed</td>" + NL + "        </tr>" + NL + "        <tr>" + NL + "          <td colspan=\"2\" align=\"center\"><html:submit>submit</html:submit></td>" + NL + "        </tr>" + NL + "      </table>" + NL + "</html:form>" + NL + "" + NL + "" + NL + "<!------------------------------------------>" + NL + "<%@ include file=\"/WEB-INF/jsp/IncludeBottom.jsp\" %>";
  protected final String TEXT_6 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    
  String[] args = (String[])argument;
  String jsp = args[1];
  String cat = args[0];

    stringBuffer.append(TEXT_1);
    stringBuffer.append(TEXT_2);
    stringBuffer.append(jsp);
    stringBuffer.append(TEXT_3);
    stringBuffer.append(cat);
    stringBuffer.append(TEXT_4);
    stringBuffer.append(jsp);
    stringBuffer.append(TEXT_5);
    stringBuffer.append(TEXT_6);
    return stringBuffer.toString();
  }
}
